﻿//cesium 三维的影响结构数据 -->
// 初始化地图

var map2dolimg = (function () {
    // 初始化
    function map2dolimg() {
        // 属性

    };
    map2dolimg.prototype.resize = function (options) {
        console.info("map2dolimgresize");

    }
    ////
    map2dolimg.prototype.init = function (options) {
        var that = this;

        this.layermaps = [];
        this.layermaps.push(new ol.layer.Tile({         
            visible: true,
            preload: Infinity,
            source: new ol.source.BingMaps({
                culture: "zh-cn",
                key: 'AnnJBLmScQLGhCET-i0R2hNlhBsnyR2pC2EXe4zCJrgWIIqbFToRle3Xwbiig6wK',
                imagerySet: "Road",
                // use maxZoom 19 to see stretched tiles instead of the
                // BingMaps
                // "no photos at this zoom level" tiles
                maxZoom: 19
            })
        }));
        this.olmap = new ol.Map({
            target: options.id,
            // The DOM element that will contains the map
            renderer: 'canvas',
            // Force the renderer to be used
            layers: this.layermaps,
            //overlays: [this.poplayer],
            // Create a view centered on the specified location and zoom level
            view: new ol.View({
                center: ol.proj.transform([178.1833, 41.3833], 'EPSG:4326', 'EPSG:3857'),
                zoom: 3,
                minZoom: 2,
                maxZoom: 21
            }),
            controls: ol.control.defaults({
                attributionOptions: false
            }).extend([]),
            interactions: ol.interaction.defaults().extend([new ol.interaction.DragRotateAndZoom()])
        });
    }
    // 返回
    return map2dolimg;
})();